package com.ywb.pojo;

import lombok.Data;

@Data
public class Result {
    private Integer code;
    private String msg;

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    private Object data;

    public static Result success(){
       Result result = new Result();
       result.code=1;
       result.msg=("操作成功");
       return result;
    }
    public static Result success(Object data) {
        Result result = new Result();
        result.code=1;
        result.msg=("操作成功");
        result.data=data;
        return result;
    }
    public static Result error(String message){
        Result result = new Result();
        result.code=0;
        result.msg=(message);
        return result;
    }
}
